/*
 * Copyright 2008 Google Inc.
 * Licensed under the Apache License, Version 2.0:
 *  http://www.apache.org/licenses/LICENSE-2.0
 */
package {

import mx.containers.Box;
import mx.controls.TextArea;
import mx.core.UIComponent;

/**
 * InfoWindowSprite consists of several ellipses arranged in a 'thought bubble'
 * manner, the largest of which contains an embedded image and a circular
 * close button.
 * It can dispatch an Event instance (type: "close"), which the user can listen
 * for and use to call map.closeInfoWindow();
 */
public class CustomInfoWindow extends UIComponent {

    public function CustomInfoWindow(content:String, width:int, height:int) {
        // Add body text
        var box:Box = new Box();
        box.width = width - 30;
        box.height = height - 15;
        var text:TextArea = new TextArea();
        text.htmlText = content;
        text.percentHeight = 100;
        text.percentWidth = 100;
        text.wordWrap = true;
        box.addChild(text);
        addChild(box);
        cacheAsBitmap = true;
    }

}

}
